﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace NodeBasedSkillEditor.Model
{
    public class ColorHandler
    {
        public Color CurrColor;

        public ColorHandler(string ColorCode)
        {
            var colorObj = ColorConverter.ConvertFromString(ColorCode);
            if (colorObj != null)
            {
                CurrColor = (Color)colorObj;
            }
            else
            {
                CurrColor = Color.FromArgb(0, 0, 0, 0);
            }
        }

        public static implicit operator Color(ColorHandler ch)
        {
            return ch.CurrColor;
        }
    }
}
